import { treeToList } from "@/utils/treeHelper";

const tagsViewRoutesModule = {
  namespaced: true,
  state: {
    tagsViewRoutes: [],
  },
  mutations: {
    // 设置 TagsView 路由
    setTagsViewRoutes(state, data) {
      state.tagsViewRoutes = treeToList(data);
    },
  },
  actions: {
    // 设置 TagsView 路由
    async getTagsViewRoutes({ commit }, data) {
      commit("setTagsViewRoutes", data);
    },
  },
};

export default tagsViewRoutesModule;
